package cn.edu.hunau.thread;

import java.util.concurrent.ForkJoinTask;

/**
 * @author hb
 * @date 2025-08-18 09:37:21
 */
public class TestThread {
    public static void main(String[] args){

        Thread t1=new Thread("t-01"){
            @Override
            public void run() {
                for (int i = 0; i < 100; i++){
                    System.out.println("\t"+getName()+"正在运行 i="+i);
                }
            }
        };
        t1.start();

        //Thread.currentThread()捕获当前正在执行的线程
        for (int i = 0; i < 100; i++){
            System.out.println(Thread.currentThread().getName()+"正在运行 i="+i);
        }
    }
}
